Enforce (node_id, artifact_name) uniqueness in published artifacts#307
Open
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Open
Enforce (node_id, artifact_name) uniqueness in published artifacts#307Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Edwardvaneechoud wants to merge 1 commit intofeauture/kernel-implementationfrom
Conversation
When a node re-runs (e.g., refresh data, collect schema), the record_published() method was appending to the published list without checking for existing artifacts with the same name. This caused duplicate entries to appear in the artifact tracker. Now record_published() removes any existing artifact with the same (node_id, kernel_id, artifact_name) before adding the new one, ensuring uniqueness and preventing duplicate artifacts on refresh. https://claude.ai/code/session_015b6B5uvhwP1jwC6Uk5ykGH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR ensures that when an artifact with the same name is published from the same node, it replaces the previous version rather than creating a duplicate. This enforces a uniqueness constraint on the combination of node_id and artifact_name.
Changes
record_published()method: Added logic to remove any existing artifact with the same name from the same node before recording a new one, ensuring (node_id, artifact_name) uniquenesstest_record_published_overwrites_same_name_same_node: Verifies that republishing the same artifact name from the same node overwrites the previous versiontest_record_published_allows_same_name_different_nodes: Confirms that different nodes can independently publish artifacts with the same nametest_record_published_allows_same_name_different_kernels: Confirms that the same node can publish the same artifact name to different kernelsImplementation Details
nameandkernel_idmatch before adding the new artifact